# 是fixture的容器，固件可以有多个：在函数中传参固件名，并且print("%s" %固件名)
# 外层conftest比内层优先级高(自动F)


import pytest


@pytest.fixture(scope="function", autouse=False,
                params=[{"username": "admin", "password": "123"}, {"username": "ad", "password": "456"}],
                ids=["success", "fail"],
                )  # name="sql" 一旦创建固件只能用别名
def exe_sql(request):
    print("执行sql语句")
    yield request.param
    print("关闭数据库")
